<?php

/**
 * @return array
 */
function getOptions()
{
    global $argv;

    $options = getopt('hf:t:n:m:a:p:r',
        [
            'type:',
            'name:',
            'module:',
            'action:',
            'params:',
            'response:',
            'summary:',
            'description:',
            'help'
        ]);

    if (isset($options['h']) || isset($options['help'])) {
        dump(help());
    }

    if (empty($options) && isset($argv[1])) {
        $options['f'] = $argv[1];
    }

    return $options;
}
